﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.ComponentModel;

namespace LanCommunity.ToolStripRenderer
{
    internal static class RendererManager
    {
        public static IRenderer Renderer
        {
            get;
            set;
        }

        static RendererManager()
        {
            //domyślny renderer
            Renderer = new NativeRenderer();
        }

        public static void Active(Form activeForm)
        {
            if (Renderer == null)
                Renderer = new NativeRenderer();

            foreach (Control c in activeForm.Controls)
            {
                if (c is ToolStrip)
                {
                    (c as ToolStrip).Renderer = Renderer.CurrentRenderer;
                }
            }
        }
    }
}
